package day16;

import java.util.Scanner;

/**
 * @author tongchen
 * @create 2023-03-22 19:49
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int count=0;
        int sum=1;
        for (int j=5;j<n;++j){
            for(int i=2;i<=Math.sqrt(j);++i){
                if(n%i==0){
                    sum+=i;
                    if(i!=n/i)
                    sum+=n/i;
                }
            }
            if(sum==j){
                count++;
            }
            sum=1;
        }

        System.out.println(count);
    }
}
